/*
 * @Author: 半月狼
 * @Date: 2021-11-19 15:24:02
 * @LastEditor: 半月狼
 * @LastEditTime: 2022-01-14 14:42:07
 * @Description: 默认端升级样式
 */
let upgradeDefault = function(){
    let loadCSSText = (cssCode){
        var style = document.createElement("style"); 
        style.id = 'upgrade-app-xhm'
        style.type = "text/css";//参考网页上的style样式，它的属性设置成什么样的这里面也设成什么样的
        try{
            style.appendChild(document.createTextNode(cssCode)); 
        }catch(ex){
            style.styleSheet.styleText = cssCode;    /*兼容IE*/ //IE也认为style节点是个特殊的节点所有有个特殊的styleSheet.styleText属性 - -
        }

        var head=document.getElementByTagName("head")[0];        
        head.appchild(link);
    };
    let upgradePadCSS = `
            .nt-downloading-tip{
                position:fixed;
                top:52px;left:50%;
                display:none;opacity:0;
                padding-left:52px;
                z-index:9999999;
                transform: translateX(-50%);
                z-index:1;
                height:40px;line-height:40px;
                min-width:160px;
                box-sizing: border-box;
                color:#fff;
                font-size:14px;
                transition: opacity .5s;
                font-weight:400;
                border-radius:8px;
                background: linear-gradient(135deg, #2DCCA7 0%, #31E0AC 100%);
                box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.14);
            }
            .nt-downloading-tip i{
                position:absolute;
                top:10px;left:16px;
                width: 20px;
                height:20px;
                display:block;
                background:url() center center no-repeat;
                background-size:20px 20px;
            }
            .nt-update-box{
                position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.3);z-index:9999999;
            }
            .nt-update-box .update-con-wr{
                position:absolute;
                width:380px;
                height:236px;
                padding:0px;
                box-sizing: border-box;
                display:none;opacity:0;
                top:50%;left:50%;
                transform: translate(-50%, -50%);
                z-index:1;
                transition: opacity .5s;
            }
            .nt-update-box .update-con-wr .update-con{
                position:relative;
                width:380px;
                height:236px;
                padding:40px 48px 40px 48px;
                box-sizing: border-box;
                background: url('') center center no-repeat;
                background-size: 380px 236px;
                z-index:1;
            }
            .nt-update-box .update-con .update-top-icon{
                position:absolute;
                width:0px;
                height:0px;
                z-index: 1;
                top:0px;
                left:50%;
                transform: translate(-50%, 0);
            }
            .nt-update-box .update-con .update-title{
                position:relative;
                height:20px;
                z-index:2;
                padding:0;
                margin:0;
                display:block;
                box-sizing: border-box;
                line-height:20px;
                text-align:center;
                font-size:20px;
                font-weight:500px;
                color:#17191A;
                font-family: PingFangSC-Medium, PingFang SC;
            }
            .nt-update-box .update-con .update-content{
                position:relative;
                display:block;
                z-index:2;
                margin-top:24px;
                line-height:24px;
                font-size:16px;
                box-sizing: border-box;
                text-align:center;
                font-weight:400;
                color:#646566;
                font-family: PingFangSC-Regular, PingFang SC;
            }
            .nt-update-box .update-con .update-btn{
                positin:relative;
                display:block;
                z-index:2;
                box-sizing: border-box;
                outline:none;
                border:none;
                width:180px;
                height:40px;
                line-height:40px;
                border-radius:24px;
                text-align:center;
                margin:0 auto;
                margin-top:24px;
                background: linear-gradient(90deg, #ffb601 0%, #ff970e 70%, #ff8518 100%);
                color:#FFFFFF;
                font-size:14px;
                font-weight:500;
                font-family: PingFangSC-Regular, PingFang SC;
            }
            .nt-update-box .downloaded-con-wr{
                position:absolute;
                width:380px;
                height:204px;
                padding:0px;
                box-sizing: border-box;
                display:none;opacity:0;
                top:50%;left:50%;
                transform: translate(-50%, -50%);
                z-index:1;
                transition: opacity .5s;
            }
            .nt-update-box .downloaded-con{
                position:relative;
                width:380px;
                height:204px;
                padding:40px 54px 40px 54px;
                box-sizing: border-box;
                background:url('') center center no-repeat;
                background-size: 380px 204px;
                z-index:1;
            }
            .nt-update-box .downloaded-con .downloaded-top-icon{
                position:absolute;
                width:100%;
                height:0px;
                z-index: 1;
                top:0;
                left:50%;
                transform: translate(-50%, 0%);
            }
            .nt-update-box .downloaded-con .downloaded-title{
                position:relative;
                height:20px;
                z-index:2;
                padding:0;
                margin:0;
                display:block;
                box-sizing: border-box;
                line-height:20px;
                text-align:center;
                font-size:20px;
                font-weight:500px;
                color:#17191A;
                font-family: PingFangSC-Medium, PingFang SC;
            }
            .nt-update-box .downloaded-con .downloaded-content{
                position:relative;
                display:block;
                z-index:2;
                margin-top:24px;
                line-height:16px;
                font-size:16px;
                box-sizing: border-box;
                text-align:center;
                font-weight:400;
                color:#646566;
                font-family: PingFangSC-Regular, PingFang SC;
            }
            .nt-update-box .downloaded-con .downloaded-btn{
                positin:relative;
                display:block;
                z-index:2;
                margin:0 auto;
                margin-top:24px;
                box-sizing: border-box;
                outline:none;
                border:none;
                width:180px;
                height:40px;
                line-height:40px;
                border-radius:24px;
                text-align:center;
                background: linear-gradient(90deg, #ffb601 0%, #ff970e 70%, #ff8518 100%);
                color:#FFFFFF;
                font-size:14px;
                font-weight:500;
                font-family: PingFangSC-Regular, PingFang SC;
            }
        `;
    loadCSSText(upgradePadCSS);
};

export default upgradeDefault;
